CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

#MESSAGE("CMAKE_SOURCE_DIR= ${CMAKE_SOURCE_DIR}")
#MESSAGE("CMAKE_BINARY_DIR= ${CMAKE_BINARY_DIR}")

PROJECT(OOJ)

# modify your wxWidgets directory HERE!
SET(wxWidgets_ROOT_DIR C:/Libs/wxWidgets)
FIND_PACKAGE(wxWidgets COMPONENTS core base REQUIRED)
INCLUDE(${wxWidgets_USE_FILE})

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

SET(CMAKE_CXX_FLAGS "-static")
#SET(CMAKE_CXX_FLAGS "-static -Wall")
#set(CMAKE_CREATE_WIN32_EXE  "")

ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(team)
ADD_SUBDIRECTORY(judge)
ADD_SUBDIRECTORY(admin)
ADD_SUBDIRECTORY(server)
ADD_SUBDIRECTORY(liboojproto)

CONFIGURE_FILE(libpthread/pthreadGC2.dll ${CMAKE_BINARY_DIR}/bin/pthreadGC2.dll COPYONLY)
CONFIGURE_FILE(libpthread/libpthreadGC2.a ${CMAKE_BINARY_DIR}/lib/pthreadGC2.a COPYONLY)
CONFIGURE_FILE(libiconv/libiconv.a ${CMAKE_BINARY_DIR}/lib/libiconv.a COPYONLY)